package com.ybkj.chat.module.login.activity;

import android.support.v4.view.ViewPager;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.TextView;

import com.ybkj.chat.R;
import com.ybkj.chat.base.BaseActivity;
import com.ybkj.chat.manager.ActivityManager;
import com.ybkj.chat.ui.adapter.GuidePageAdapter;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

/**
 * 引导页
 */
public class ViewPagerActivity extends BaseActivity {


    @BindView(R.id.viewpager)
    ViewPager viewpager;
    private List<View> viewList = new ArrayList<>();

    private TextView btnInto;
    private GuidePageAdapter adapter;

    @Override
    protected void initTitle() {


    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_view_pager;
    }

    @Override
    protected void initView() {

    }


    @Override
    protected void initData() {
        LayoutInflater lf = getLayoutInflater().from(mContext);
        View view1 = lf.inflate(R.layout.splain_view1, null);
        View view2 = lf.inflate(R.layout.splain_view2, null);
        View view3 = lf.inflate(R.layout.splain_view3, null);
        viewList.add(view1);
        viewList.add(view2);
        viewList.add(view3);
        viewpager.setAdapter(new GuidePageAdapter(viewList));
        btnInto = view3.findViewById(R.id.btn_into);
        btnInto.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                ActivityManager.gotoActivity(mContext, LoginActivity.class);
                finish();
            }
        });
    }

    @Override
    public boolean isImmersiveStatusBar() {
        return true;
    }
}
